package com.aabbc.database;

import com.aabbc.database.config.MultiDataSourceRegister;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Import;

/**
 * MysqlWriteReadApplicationStarter
 *
 * @author: chenfenghai
 * @version: 1.0
 * @date: 2020-04-02 10:45
 * @blame Team
 */
@Import(MultiDataSourceRegister.class)
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
public class MysqlWriteReadApplicationStarter {

    public static void main(String[] args) {
        ApplicationContext context = SpringApplication.run(MysqlWriteReadApplicationStarter.class, args);

        Object object = context.getBean("multiRoutingDataSource");
        System.out.println("bean: " + object);
    }
}
